package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper  //一定要加上此注解,加上之后才能说明它是 mybatis 接口
public interface UserMapper {
    //查询所有
    public List<UserInfo> getAll();
    //根据id查询
    public UserInfo getUserById(@Param("uid") Integer id); //拿到uid的值赋值给id,但xml配置文件中参数要写uid
    //public  List<UserInfo> getUserByName(@Param("username") String name);

    //使用resultMap
    public  List<UserInfo> getUserByName(@Param("username") String name);
    //添加用户
    public int add(@Param("username")String name,
                   @Param("password")String password,
                   @Param("photo")String photo);

    //多条用户的删除
    public int delByIds(@Param("ids") List<Integer> ids);

}
